<?php
/**
 * Implements a MySQL SELECT query
 */
class MySQLSelect extends SQLSelect {
	/**
	 * Outputs query as string.
	 * 
	 * (non-PHPdoc)
	 * @see SQLSelect::toString()
	 */
	public function toString() {
		return "".
		"SELECT" 																	."\r\n".
		($this->objOptions?$this->objOptions->toString():"") 						."\r\n".
		($this->objColumns?$this->objColumns->toString():"*") 						."\r\n".
		"FROM ".($this->objAlias?$this->objAlias->toString():$this->strTableName)	."\r\n".
		($this->objJoins?$this->objJoins->toString():"")							."\r\n".
		"WHERE" 																	."\r\n".
		"".($this->objConditions?$this->objConditions->toString():"1")				."\r\n".
		($this->objGroupBy?"GROUP BY ".$this->objGroupBy->toString():"") 			."\r\n".
		($this->objHaving?"HAVING ".$this->objHaving->toString():"")				."\r\n".
		"ORDER BY ".($this->objOrderBy?$this->objOrderBy->toString():"NULL")		."\r\n".
		($this->objLimit?"LIMIT ".$this->objLimit->toString():"");
	}
}